<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>[ Benetton Photograph 班尼頓寫真攝影 ] 網站上傳界面</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/swfupload.js"></script>
<script type="text/javascript" src="../js/swfupload.queue.js"></script>
<script type="text/javascript" src="../js/fileprogress.js"></script>
<script type="text/javascript" src="../js/handlers.js"></script>
<script type="text/javascript">
        var global_working_photo_add_upload_image_url = [];
		var swfu;
        <?php 
        //$sid = session_id();
        $sid = $_REQUEST['sid'];
        ?>
		window.onload = function() {
			var settings = {
				flash_url : "../js/swfupload.swf",
				upload_url: "uploadify.php",
				post_params:{'<?php echo session_name();?>':'<?php echo$sid;?>','responsetype':'sizeinfo'},
				file_size_limit : "100 MB",
				file_types : "*.jpg;*.jpeg;*.gif;*.png",
				file_types_description : "Image Files",
				file_upload_limit : 100,
				file_queue_limit : 0,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,

				// Button settings
				button_image_url: "../images/upload-bg.png",
				button_width: "100",
				button_height: "29",
				button_placeholder_id: "spanButtonPlaceHolder",
				button_text: '<span class="theFont">選擇圖片</span>',
				button_text_style: ".theFont { font-size: 14; color:#ffffff; line-height: 29px; font-weight: bold; text-align: center; }",
				button_text_left_padding: 0,
				button_text_top_padding: 6,
				
				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event,
			};

			swfu = new SWFUpload(settings);
	     };
	     function awf_upload_image_call_back(response)
	     {
	    	 try {
	    		 var responseObj = eval("("+response+")");
				 var fileName = responseObj.name;
				// global_working_photo_add_upload_image_url.push(fileName);
				if ( typeof(parent.working_photo_add_uploaded_image)  == 'function' ){
					parent.working_photo_add_uploaded_image(fileName);
				}
	    	 }catch (ex) {
		    	 alert(ex);
	    	 }
	     }
	     function awf_upload_image_complete_call_back(numFilesUploaded)
	     {
		     if ( typeof(parent.working_photo_add_uploaded_image_complete)  == 'function' ){
					parent.working_photo_add_uploaded_image_complete();
				}
	     }
	</script>
</head>
<body>
<div id="header">
	<h1 id="logo"><a href="../">SWFUpload</a></h1>
	<div id="subname">後台上傳功能</div>
</div>

<div id="content">
	<h2>可以同時選擇多檔案上傳</h2>
	<form id="form1" action="index.php" method="post" enctype="multipart/form-data">
		<p>可以一次上傳多張圖檔，單一檔案大小限製為4MB。如果超過檔案限制，將會無法順利上傳。</p>

			<div class="fieldset flash" id="fsUploadProgress">
			<span class="legend">上傳中的檔案</span>
			</div>
		<div id="divStatus">0 Files Uploaded</div>
			<div>
				<span id="spanButtonPlaceHolder"></span>
				<input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
			</div>

	</form>
</div>
</body>
</html>
